//
//  MyZoneHeaderView.m
//  Team
//
//  Created by lanou3g on 16/1/16.
//  Copyright © 2016年 ZJF. All rights reserved.
//

#import "MyZoneHeaderView.h"

#define kWidth self.frame.size.width/8.0
#define kHeight self.frame.size.height/4.0

@implementation MyZoneHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        btn.frame = CGRectMake(kWidth*3.0, kHeight/2.0, kWidth*2.0, kHeight*2.0);
        btn.backgroundColor = [UIColor redColor];
        btn.layer.cornerRadius = kWidth;
        [btn addTarget:self action:@selector(checkDetail:) forControlEvents:UIControlEventTouchUpInside];
        
        UIImageView *imgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kWidth*2.0, kHeight*2.0)];
        imgView.backgroundColor = [UIColor cyanColor];
        imgView.layer.cornerRadius = kWidth;
        [btn addSubview:imgView];
        
        [self addSubview:btn];
        
        UILabel *label4Name = [[UILabel alloc] initWithFrame:CGRectMake(kWidth*3.0, kWidth*2.5, kWidth*2.0, kWidth)];
        label4Name.backgroundColor = [UIColor clearColor];
        label4Name.text = @"name";
        label4Name.textAlignment = NSTextAlignmentCenter;
        [self addSubview:label4Name];
    }
    return self;
}



-(void)checkDetail:(UIButton *)sender{
    
    NSLog(@"==========");
}





/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
